package com.llz.leaveApply.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Result {
    private Boolean success;
    private String errorMsg;
    private Object data;
    private Object message;
    private Long total;


    public static Result ok(){
        return new Result(true, null,null, null, null);
    }
    public static Result ok(Object data){
        return new Result(true, null, data, null,null);
    }
        public static Result ok(String successMsg){
        return new Result(true, null, null,successMsg, null);
    }
        public static Result ok2(String data){
        return new Result(true, null, data,null, null);
    }


//    public static Result ok(List<?> data, Long total){
//        return new Result(true, null, data, total);
//    }
    public static Result fail(String errorMsg){
        return new Result(false, errorMsg,null, null, null);
    }


}
